﻿using System.Collections.Generic;
using SqlHelper;

namespace Service.Permission
{
    public class MenuService : Repository<Model.Permission.Menu>
    { 
        public List<Model.Permission.Menu> HasMenus(string ids)
        {
           return GetListSQL<Model.Permission.Menu>($"select MenuID,Name,Description,CreateTime,ParentID,MenuType,Urls,UpdateTime from TMenu where ParentID IN ({ids}) OR MenuID IN ({ids}) ");
        }

        public List<Model.Permission.Menu> NoHasMenus(string ids)
        {
            return GetListSQL<Model.Permission.Menu>($"select MenuID,Name,Description,CreateTime,ParentID,MenuType,Urls,UpdateTime from TMenu where ParentID NOT IN ({ids}) AND MenuID NOT IN ({ids}) ");
        }
    }
}
